//
//  ForEachDemo.swift
//  SwiftUIDemo
//
//  Created by Tilt Wang on 2025/6/25.
//

import SwiftUI

struct ForEachDemo: View {
    
    let data: [String] = ["Hi", "Hello", "Hey"]
    let myString: String = "Hello"
    
    var body: some View {
        VStack {
            ForEach(data.indices) { index in
                HStack {
                    Circle()
                        .frame(width: 30, height: 30)
                    Text("\(data[index]): \(index)")
                }
            }
            Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
            Text("Hello, World!")
            Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
        }
    }
}

#Preview {
    ForEachDemo()
}
